package cn.tutu.blockchain.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.PageInfo;

import cn.tutu.blockchain.common.MsgObj;
import cn.tutu.blockchain.common.Page;
import cn.tutu.shop.entity.Product;
import cn.tutu.shop.service.ProductService;

@RestController
@RequestMapping("/product")
public class ProductController {

	@Autowired
	private ProductService productService;

	@RequestMapping("/getGrid")
	public MsgObj getGrid(Page page) {

		PageInfo<Product> info = productService.getAll(page);

		return MsgObj.buildSuccessObj(info.getList());

	}

}
